<?php
/**
 * @version		$Id: default_items.php 20196 2011-01-09 02:40:25Z ian $
 * @package		Joomla.Site
 * @subpackage	com_contact
 * @copyright	Copyright (C) 2005 - 2011 Open Source Matters, Inc. All rights reserved.
 * @license		GNU General Public License version 2 or later; see LICENSE.txt
 */

// no direct access
defined('_JEXEC') or die;

JHtml::_('behavior.framework',true);

$listOrder	= $this->escape($this->state->get('list.ordering'));
$listDirn	= $this->escape($this->state->get('list.direction'));
?>
<div class="contact component">
	<?php if (empty($this->items)) : ?>
		<p> <?php echo JText::_('COM_CONTACT_NO_ARTICLES'); ?>	 </p>
	<?php else : ?>

	<form action="<?php echo htmlspecialchars(JFactory::getURI()->toString()); ?>" method="post" class="form-form" name="adminForm" id="adminForm">
	<?php if (intval(JVERSION) >= 3 && $this->params->get('filter_field') != 'hide') :?>
		<fieldset class="filters yjsearchfilter yjsg-fieldset-collapse form-fieldset">
			<div class="btn-group">
				<input type="text" name="filter-search" id="filter-search" value="<?php echo $this->escape($this->state->get('list.filter')); ?>" class="inputbox form-field" onchange="document.adminForm.submit();" title="<?php echo JText::_('COM_CONTACT_FILTER_SEARCH_DESC'); ?>" placeholder="<?php echo JText::_('COM_CONTACT_FILTER_SEARCH_DESC'); ?>" />
			</div>
		</fieldset>
	<?php endif; ?>
	<?php if ($this->params->get('show_pagination_limit')) : ?>
		<fieldset class="filters yjsg-fieldset-collapse form-fieldset">
		<legend class="hidelabeltxt element-hide"><?php echo JText::_('JGLOBAL_FILTER_LABEL'); ?></legend>
			<div class="display-limit">
				<?php echo JText::_('JGLOBAL_DISPLAY_NUM'); ?>&#160;
				<?php echo $this->pagination->getLimitBox(); ?>
			</div>
		</fieldset>
	<?php endif; ?>
		<table class="category table-bordered">
			<?php if ($this->params->get('show_headings')) : ?>
			<thead><tr>
				
				<th class="sectiontableheader">
					<?php echo JHtml::_('grid.sort', 'COM_CONTACT_CONTACT_EMAIL_NAME_LABEL', 'a.name', $listDirn, $listOrder); ?>
				</th>
				<?php if ($this->params->get('show_position_headings')) : ?>
				<th class="sectiontableheader">
					<?php echo JHtml::_('grid.sort', 'COM_CONTACT_POSITION', 'a.con_position', $listDirn, $listOrder); ?>
				</th>
				<?php endif; ?>
				<?php if ($this->params->get('show_email_headings')) : ?>
				<th class="sectiontableheader">
					<?php echo JText::_('JGLOBAL_EMAIL'); ?>
				</th>
				<?php endif; ?>
				<?php if ($this->params->get('show_telephone_headings')) : ?>
				<th class="sectiontableheader">
					<?php echo JText::_('COM_CONTACT_TELEPHONE'); ?>
				</th>
				<?php endif; ?>
	
				<?php if ($this->params->get('show_mobile_headings')) : ?>
				<th class="sectiontableheader">
					<?php echo JText::_('COM_CONTACT_MOBILE'); ?>
				</th>
				<?php endif; ?>
	
				<?php if ($this->params->get('show_fax_headings')) : ?>
				<th class="sectiontableheader">
					<?php echo JText::_('COM_CONTACT_FAX'); ?>
				</th>
				<?php endif; ?>
	
				<?php if ($this->params->get('show_suburb_headings')) : ?>
				<th class="sectiontableheader">
					<?php echo JHtml::_('grid.sort', 'COM_CONTACT_SUBURB', 'a.suburb', $listDirn, $listOrder); ?>
				</th>
				<?php endif; ?>
	
				<?php if ($this->params->get('show_state_headings')) : ?>
				<th class="sectiontableheader">
					<?php echo JHtml::_('grid.sort', 'COM_CONTACT_STATE', 'a.state', $listDirn, $listOrder); ?>
				</th>
				<?php endif; ?>
	
				<?php if ($this->params->get('show_country_headings')) : ?>
				<th class="sectiontableheader">
					<?php echo JHtml::_('grid.sort', 'COM_CONTACT_COUNTRY', 'a.country', $listDirn, $listOrder); ?>
				</th>
				<?php endif; ?>
	
				</tr>
			</thead>
			<?php endif; ?>
	
			<tbody>
				<?php foreach($this->items as $i => $item) : ?>
					<?php if ($this->items[$i]->published == 0) : ?>
						<tr class="system-unpublished sectiontableentry<?php echo $i % 2+1; ?>">
					<?php else: ?>
						<tr class="sectiontableentry<?php echo $i % 2+1; ?>" >
					<?php endif; ?>
	
						<td class="item-title">
							<a href="<?php echo JRoute::_(ContactHelperRoute::getContactRoute($item->slug, $item->catid)); ?>">
								<?php echo $item->name; ?></a>
						</td>
	
						<?php if ($this->params->get('show_position_headings')) : ?>
							<td class="item-position">
								<?php echo $item->con_position; ?>
							</td>
						<?php endif; ?>
	
						<?php if ($this->params->get('show_email_headings')) : ?>
							<td class="item-email">
								<?php echo $item->email_to; ?>
							</td>
						<?php endif; ?>
	
						<?php if ($this->params->get('show_telephone_headings')) : ?>
							<td class="item-phone">
								<?php echo $item->telephone; ?>
							</td>
						<?php endif; ?>
	
						<?php if ($this->params->get('show_mobile_headings')) : ?>
							<td class="item-phone">
								<?php echo $item->mobile; ?>
							</td>
						<?php endif; ?>
	
						<?php if ($this->params->get('show_fax_headings')) : ?>
						<td class="item-phone">
							<?php echo $item->fax; ?>
						</td>
						<?php endif; ?>
	
						<?php if ($this->params->get('show_suburb_headings')) : ?>
						<td class="item-suburb">
							<?php echo $item->suburb; ?>
						</td>
						<?php endif; ?>
	
						<?php if ($this->params->get('show_state_headings')) : ?>
						<td class="item-state">
							<?php echo $item->state; ?>
						</td>
						<?php endif; ?>
	
						<?php if ($this->params->get('show_country_headings')) : ?>
						<td class="item-state">
							<?php echo $item->country; ?>
						</td>
						<?php endif; ?>
	
					</tr>
				<?php endforeach; ?>
	
			</tbody>
		</table>
	
		<?php if ($this->params->get('show_pagination')) : ?>
		<div class="pagination">
			<?php if ($this->params->def('show_pagination_results', 1)) : ?>
			<p class="counter">
				<?php echo $this->pagination->getPagesCounter(); ?>
			</p>
			<?php endif; ?>
			<?php echo $this->pagination->getPagesLinks(); ?>
		</div>
		<?php endif; ?>
		<div>
			<input type="hidden" name="filter_order" value="<?php echo $listOrder; ?>" />
			<input type="hidden" name="filter_order_Dir" value="<?php echo $listDirn; ?>" />
			<input type="hidden" name="task" value="" />
		</div>
	</form>

<?php endif; ?>
</div>